#include<iostream>
#include<fstream>
#include<string>
#include<regex>
using namespace std;


int main()
{
	ifstream in("email.txt");
	if (!in)
	{
		cout << "Failue!" << endl;
		return -1;
	}
	string line;
	string str = "";
	while (getline(in, line))
	{
		str += line;
	}
	regex reg("[a-zA-Z]+@[a-zA-Z]+\\.[a-zA-Z]+");
	sregex_iterator it(str.begin(), str.end(), reg);
	auto end_it = sregex_iterator();
	for (; it != end_it; it++)
	{
		cout << it->str() << endl;
	}
}

